import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:honeypotflutter/modules/home/view/home_banner.dart';
import 'package:honeypotflutter/public/public_baseState.dart';
import 'package:honeypotflutter/publicBussine/bussine_colors.dart';
import 'package:honeypotflutter/public/views/public_appBar.dart';
import 'package:honeypotflutter/public/views/public_scrollView.dart';
import '../../view/home_cards.dart';
import '../../view/home_modules.dart';
import '../../view/home_phone.dart';
import 'logic.dart';

class HomePage extends StatefulWidget {
  const HomePage({Key? key}) : super(key: key);

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends HLBaseState<HomePage> {
  final HomeLogic logic = Get.put(HomeLogic());

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: MGColors.whileColor,
      appBar: HLAppBar(
        navigationTitle: "蜜罐管家",
        showBackLeading: false,
      ),
      body: HLScrollView(
        padding: EdgeInsets.only(left: 12, right: 12),
        children: [
          HomeBanner(),
          HomeCards(),
          HomeModules(),
          HomePhone(),
        ],
      ),
    );
  }

  @override
  void didPopNext() {
    logic.request();
  }

  @override
  void dispose() {
    Get.delete<HomeLogic>();
    super.dispose();
  }
}
